#pragma once

#include <Windows.h>

#include <vector>

using std::vector;

namespace xgu{ namespace Threading{

class WaitHandle
{
public:
	WaitHandle();
	virtual ~WaitHandle();

	void WaitOne() const;

	HANDLE getSafeWaitHandle() const
	{
		return handle_;
	}

	static void WaitAll(const vector<WaitHandle>& whs);
	static void WaitAny(const vector<WaitHandle>& whs);

protected:
	virtual HANDLE CreateEvent(bool initial_state);

private:
	HANDLE handle_;
};

}}
